<!DOCTYPE html>
<html lang="zh-cmn-Hans">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
		<title>鹿程智慧油站商户平台</title>
		<meta name="description" content="鹿程科技是提供加油站互联网化零管系统、营销及支付和大数据分析运营服务的行业领先科技公司。鹿程科技充分了解加油站行业的需求和新兴互联网的发展,依靠业内最先进的科技和标准化的运营,持续帮助油站业务发展创造价值。"/>
		<meta name="keywords" content="智慧油站,鹿程,鹿程智慧油站,鹿程智慧油站微信支付,加油站微信支付,加油站营销管理"/>
		<link rel="icon" href="https://static.zhihuiyouzhan.com.cn/static/styles/admin/img/title.ico" type="image/x-icon">
		<link rel="shortcut icon" href="https://static.zhihuiyouzhan.com.cn/static/styles/admin/img/title.ico" type="image/x-icon">
		<link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
		<link rel="stylesheet" href="../layui/css/layui.css" />
		<link rel="stylesheet" href="../css/style.css" />
	</head>
<body>
	<section class="section-right">
		<!--deer-tit-->
		<div class="deer-tit">
			<h3>便利店</h3>
			<h5>商品分类</h5>
			<h4>分类修改</h4>
		</div>
		<!--/deer-tit-->
		<!--deer-content-->
		<div class="deer-content">
			<div class="ware-add">
				<form action="#" class="layui-form ware-add-form">
					<dl>
					    <dt>编号</dt>
					    <dd><input type="text" disabled="disabled" lay-verType="tips" placeholder="请输入商品编号" autocomplete="off" value="66"  class="layui-input layui-disabled"></dd>
				    </dl>
				    <dl>
					    <dt>分类名称</dt>
					    <dd><input type="text" name="cate_name" lay-verify="title" lay-verType="tips" placeholder="请输入商品名称" autocomplete="off" class="layui-input ware-add-tit"></dd>
				    </dl>
				    <dl>
					    <dt>是否启用</dt>
					    <dd>
					    	<select name="state" lay-filter="state">
						        <option value="0" selected>启用</option>
						        <option value="1">不启用</option>
						    </select>
					    </dd>
				    </dl>
					<button class="submit" lay-submit lay-filter="Submit" >提交</button>
				</form>
			</div>
		</div>
		<!--/deer-content-->
	</section>
	
	<!--js-->
	<aside>
		
		<script type="text/javascript" src="../layui/layui.js" ></script>
		<script type="text/javascript">
			
			layui.use(['form','jquery'],function(){
				var	form=layui.form;
				var $=layui.jquery;
				
				//表单验证
				form.verify({
				title:function(){   //判断是否选择分类
						var val=$('.ware-add-tit').val()
							if(val==""){
								return '商品名称不得为空'
							}else{
							return false
						}
					}
		 		})
				
				//表单提交
				form.on('submit(Submit)', function(data){
					console.log(data.field) //当前容器的全部表单字段，名值对形式：{name: value}
					
					$.ajax({
			            url: '/',
			            data: data.field,
			            type: 'post',
			            datatype: 'json',
			            success: function (res) {
				                if (res.code == 1) {
				                	
				                	layer.msg(res.msg);
				                    return;
				                }
				            }
				        });
					return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
				});
				
				
				
				
			})
			
		</script>
		
		
		
	</aside>
	<!--/js-->
</body>
</html>